/*
 * BanBu_FunctionPage
 * @description 本文件提供引导页界面的View
 * @package
 * @author 		***
 * @copyright
 * @version 		1.0
 * @description 本文件提供引导页界面的View
 */

#import "BanBu_FunctionPage.h"

//#define TextFrameHeight 120
@implementation BanBu_FunctionPage


- (id)initWithFunctionPageStyle:(FunctionPageStyle)_style
{
    if([super init])
    {
        [self initDataWithStyle:_style];
    }
    return self;
}

/**
 *	@brief	初始化引导页属性
 *
 *	@param 	_style 	引导页标示
 */
-(void)initDataWithStyle:(FunctionPageStyle)_style
{
    switch (_style) {
        case FunctionPageStyleNearTap:
        {

            self.text = NSLocalizedString(@"nearTapPage", nil);
            self.imageName = @"nearTap.png";
            
            CGFloat height = [self.text sizeWithFont:[UIFont boldSystemFontOfSize:20] constrainedToSize:CGSizeMake(280, 120) lineBreakMode:kTextLineBreakByWordWrapping].height;
            self.textFrame = CGRectMake(10, __MainScreen_Height+20-height-130, 300, height);
        }
            break;
        case FunctionPageStyleNearFilter:
        {
            self.text = NSLocalizedString(@"nearFilterPage", nil);
            self.imageName = @"nearfilter.png";
            CGFloat height = [self.text sizeWithFont:[UIFont boldSystemFontOfSize:20] constrainedToSize:CGSizeMake(280, 120) lineBreakMode:kTextLineBreakByWordWrapping].height;
            self.textFrame = CGRectMake(10, 190, 300, height);
        }
            break;
        case FunctionPageStyleSpaceTap:
        {
            self.text = NSLocalizedString(@"spaceProfilePage", nil);
            self.imageName = @"myspaceF.png";
            CGFloat height = [self.text sizeWithFont:[UIFont boldSystemFontOfSize:20] constrainedToSize:CGSizeMake(280, 120) lineBreakMode:kTextLineBreakByWordWrapping].height;
            self.textFrame = CGRectMake(10,  __MainScreen_Height+20-height-180, 300, height);
        }
            break;
        case FunctionPageStyleSpaceSetting:
        {
            self.text = NSLocalizedString(@"spaceSettingPage", nil);
            self.imageName = @"setting.png";
            CGFloat height = [self.text sizeWithFont:[UIFont boldSystemFontOfSize:20] constrainedToSize:CGSizeMake(280, 120) lineBreakMode:kTextLineBreakByWordWrapping].height;
            
            self.textFrame = CGRectMake(10, 255 - height, 300, height);

        }
            break;
        case FunctionPageStyleSpaceProfile:
        {
            self.text = NSLocalizedString(@"spaceTapPage", nil);
            self.imageName = @"addprofile.png";
            CGFloat height = [self.text sizeWithFont:[UIFont boldSystemFontOfSize:20] constrainedToSize:CGSizeMake(280, 120) lineBreakMode:kTextLineBreakByWordWrapping].height;
            self.textFrame = CGRectMake(10, 280, 300, height);
        }
            break;
            //动态
        case FunctionPageStyleSpaceDynamic:
        {
            self.text = NSLocalizedString(@"spaceDynamicPage", nil);
            self.imageName = @"mydynamic.png";
            CGFloat height = [self.text sizeWithFont:[UIFont boldSystemFontOfSize:20] constrainedToSize:CGSizeMake(280, 120) lineBreakMode:kTextLineBreakByWordWrapping].height;
            self.textFrame = CGRectMake(10, 280, 300, height);

        }
            break;
            //表情商店
        case FunctionPageStyleSpaceEmoShop:
        {
            self.text = NSLocalizedString(@"spaceEmoShopPage", nil);
            self.imageName = @"shop_Emo.png";
            CGFloat height = [self.text sizeWithFont:[UIFont boldSystemFontOfSize:20] constrainedToSize:CGSizeMake(280, 120) lineBreakMode:kTextLineBreakByWordWrapping].height;
            self.textFrame = CGRectMake(10, 255 - height, 300, height);

        }
        default:
            break;
    }
    if (__MainScreen_Height<500) {
        self.imageName = [NSString stringWithFormat:@"%@_3.5.png",[self.imageName substringToIndex:self.imageName.length-4]];
    }
}
@end
